
<template>
    <div class="common-layout w-full h-screen">
      <el-container class=" h-full">
        <el-header class=" text-2xl text-center shadow-2xl border-b-4 flex items-center justify-center">后台管理</el-header>
        <el-container>
          <el-aside width="200px" class="bg-gray-100 border-r-2 border-gray-300">
            <el-menu>
              <el-menu-item index="1"  class="bg-gray-200 border-b-2 border-b-gray-300 ">
                <template #title>
                  <el-icon></el-icon>
                  <span @click="toauitLoan">审核贷款申请</span>
                </template>
              </el-menu-item>
              <el-menu-item @click="toUserManage" index="2"  class="border-b-2 bg-gray-200 border-b-gray-300">
                <template #title>
                  <el-icon></el-icon>
                  <span>用户管理</span>
                </template>
              </el-menu-item>
            </el-menu>
          </el-aside>
          <el-container class="bg-gray-200">

            <el-main class="h-96"><el-scrollbar>
              <router-view  :key="$route.fullPath" ></router-view>
            </el-scrollbar>
            </el-main>
            <el-footer class="bg-gray-600"></el-footer>
          </el-container>
        </el-container>
      </el-container>
    </div>
</template>

<script>
import axios from "axios";
import {ElMessage, ElMessageBox} from "element-plus";

export default {
  data(){

  },
  methods: {
  toUserManage(){
    this.$router.push("/userManage");
  },
    toauitLoan(){
      this.$router.push("/auitLoan");
    }
  },
  mounted() {
    ElMessageBox.prompt("密钥",'请输入管理员密钥',{
    }).then(value => {
      if(value.value==="rooter1"){

        axios.post("http://localhost:8080/managerLogin",{managerName:"root",managerPwd:"123456"}).then(res=>{
          localStorage.setItem("rootToken",res.data.data);
          ElMessage("登陆成功");
        })
      }
    })
  }
}

</script>

<style>
*{
  margin: 0;
  padding: 0;
}




</style>